﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FunArts.EasyDevOps.Shared.Models.SshClient.KeepAlivedClient
{
    /// <summary>
    /// 虚拟服务器配置
    /// </summary>
    public class VirtualServer
    {
        /// <summary>
        /// 虚拟IP地址
        /// </summary>
        public string IpAddress { get; set; }

        /// <summary>
        /// 虚拟端口号
        /// </summary>
        public int Port { get; set; } = 80;

        /// <summary>
        /// 延迟循环时间(秒)
        /// </summary>
        public int DelayLoop { get; set; } = 6;

        /// <summary>
        /// 负载均衡算法(rr|wrr|lc|wlc|lblc|sh|dh)
        /// </summary>
        public string LbAlgo { get; set; } = "rr";

        /// <summary>
        /// 负载均衡类型(NAT|DR|TUN)
        /// </summary>
        public string LbKind { get; set; } = "NAT";

        /// <summary>
        /// 持久化超时时间(秒)
        /// </summary>
        public int PersistenceTimeout { get; set; } = 50;

        /// <summary>
        /// 协议类型(TCP|UDP)
        /// </summary>
        public string Protocol { get; set; } = "TCP";

        /// <summary>
        /// 真实服务器列表
        /// </summary>
        public List<RealServer> RealServers { get; set; } = new List<RealServer>();

        /// <summary>
        /// 是否启用持久化
        /// </summary>
        public bool Persistence { get; set; } = true;

        /// <summary>
        /// 超时设置
        /// </summary>
        public TimeoutSettings Timeout { get; set; } = new TimeoutSettings();
        /// <summary>
        /// 健康检查配置
        /// </summary>
        public HealthCheck HealthCheck { get; set; }
    }
}
